package com.aistar.hotel.mapper;


import com.aistar.hotel.entity.HotelCommentReplay;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;


/**
 * Created by wubin on 2019/6/23.
 */
public interface HotelCommentReplayMapper {
    @Select("select * from hotelcommentreplay where replay_text like concat('%',#{replay_text},'%')")
    List<HotelCommentReplay> findAll(String replaytext);

    @Select("select * from hotelcommentreplay where hotel_replay_id=#{id}")
    HotelCommentReplay findById(String hotelReplayId);

    @Insert("insert into hotelcommentreplay values(#{hotelReplayId},#{repalyId},#{replayTime},#{replayText})")
    void save(HotelCommentReplay hotelCommentReplay);

    @Delete("delete from hotelcommentreplay where hotel_replay_id=#{hotelReplayId}")
    void delete(String hotelReplayId);

    @Update("update hotelcommentreplay set replay_id=#{repalyId},replay_text=#{replayText} where hotel_replay_id=#{hotelReplayId}")
    void update(HotelCommentReplay hotelCommentReplay);
}
